package com.wkbb.common.enums;

/**
 * 城市的类型，0是国，1是省，2是市，3是区
 */
public enum DistrictTypeEnum {
    /**
     * 国家
     */
    COUNTRY(0,"国家"),
    /**
     * 省
     */
    PROVINCE(1,"省份"),
    /**
     * 城市
     */
    CITY(2,"城市"),
    /**
     * 区
     */
    AREA(3,"区/县/镇");

    private DistrictTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private Integer value;

    private String desc;

    public Integer getValue() {
        return this.value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return this.desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (DistrictTypeEnum districtType : DistrictTypeEnum.values()) {
            if (districtType.getValue().intValue()==value) {
                return districtType.getDesc();
            }
        }
        return null;
    }
}
